

export function debounce(fn, delay) {
    let time = null;//time用来控制事件的触发
    return function (msg) {
        if (time !== null) {
            clearTimeout(time);
        }
        time = setTimeout(() => {
            fn.call(this, msg);
            //利用call(),让this的指针从指向window 转成指向input
        }, delay)
    }
}